<template>
  <div class="city">
    <city-header></city-header>
    <List 
    :cities='cities'
    :hotCities='hotCities'
    />
  </div>
</template>

<script>
import CityHeader from "./pages/Header";
import List from "./pages/List";
export default {
  data() {
    return {
      hotCities: [],
      cities: {}
    };
  },
  components: {
    CityHeader,
    List
  },
  mounted() {
    this.$http.get('/api/city.json')
    .then((res) => {
      // console.log(res);
      let data = res.data.data;
      this.hotCities = data.hotCities;
      this.cities = data.cities;
    });
  }
};
</script>

<style scoped>
.city {
  background: #f5f5f5;
}
</style>
